package com.portal.incurridos.persistence.user;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * @author Alan Dávila
 * e-mail ustargab@gmail.com
 * date 07/11/2013 23:20:22
 */
@Entity
@Table(schema = "userapp", name = "userapp")
public class User {
//	@Resource(name = "messageSource")
//    private DelegatingMessageSource mensajes;
	/**
	 * Identifier of login.
	 */
	@Id
	private String login;
	/**
	 * Clave del login.
	 */
	private String password;
	/**
	 * Lista de roles.
	 */
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(name = "login")
	private List<UserRole> roles;
	/**
	 * @return the login
	 */
	public final String getUsuario() {
		return login;
	}
	/**
	 * @param usuarioIn the login to set
	 */
	public final void setUsuario(final String usuarioIn) {
		this.login = usuarioIn;
	}
	/**
	 * @return the password
	 */
	public final String getClave() {
		return password;
	}
	/**
	 * @param claveIn the password to set
	 */
	public final void setClave(final String claveIn) {
		this.password = claveIn;
	}
}
